Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add payload to ClientError and structure message #242

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Jul 25, 2024

No description provided.

@tdstein tdstein requested a review from dbkegley July 25, 2024 14:21
Copy link

github-actions bot commented Jul 25, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1230 1161 94% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/posit/connect/errors.py 100% 🟢
src/posit/connect/hooks.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 94dc79e by action🐍

"http_message": http_message,
"payload": payload,
}
super().__init__(json.dumps(message))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the payload is sometimes a JSON object, it seems appropriate to structure the entire message. My initial implementation appended the payload to the end of the existing string, but I thought that looked odd.

example, error message (Error Code: 0, HTTP Status: 404 Foo Bar) { 'payload': 'object' }

@tdstein tdstein marked this pull request as ready for review July 26, 2024 01:24
@dbkegley
Copy link
Collaborator

Thanks for jumping on this!

@tdstein tdstein merged commit a6385a4 into main Jul 26, 2024
30 checks passed
@tdstein tdstein deleted the tdstein/234-add-payload-to-error-handling branch July 26, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants